package com.gagakuai.util;

import cn.hutool.core.util.ObjectUtil;
import com.gagakuai.exception.SettementException;

/*
 * 验证工具
 *
 */
public class ValidationUtil {

    /*
     * 验证空
     */
    public static void isNull(Object obj, String entity, String parameter, Object value) {
        if (ObjectUtil.isNull(obj)) {
            String msg = entity + " 不存在: " + parameter + " is " + value;
            throw new SettementException(msg);
        }
    }

    /*
     * 验证是否为邮箱
     */
    public static boolean isEmail(String email) {
        //TODO 邮箱验证
        return false;
    }

}
